﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="">
//   
// </copyright>
// <summary>
//   The program.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DungeonGenerator
{
    using System;
    using System.ComponentModel;

    /// <summary>
    /// The program.
    /// </summary>
    internal class Program
    {
        static void Main()
        {
            //var shortD = new Generator(20, 20, 10, 0, 75, new TestRandomizer(0));
            //var longD= new Generator(80,25,40, 0, 75, new TestRandomizer(0));
           // var d = new Generator(80, 25, 40, 0, 75, new TestRandomizer(0));
            int x = 30;
            int y = 25;
            int objects = 2;
            int seed = 1;
						var tr = new TestRandomizer(seed);
						var d = new DungeonGenerator.Java.Generator(tr, s => s.Dump());
						d.CreateDungeon(x, y, objects);
						tr.RandomsCount.Dump("randoms");
						
            
            var rnd = new TestRandomizer(seed);
            var jd = new Java.JDungeon(rnd, Console.WriteLine);
            jd.CreateDungeon(x, y, objects);
            var dungeonArray = jd.GetDungeon();

            var dungeon = new char[x, y];
            for (int j = 0; j < y; j++)
                for (int i = 0; i < x; i++)
                {
                    try
                    {
                        dungeon[i, j] = jd.GetCellTile(i, j);
                    }
                    catch (IndexOutOfRangeException ex)
                    {
                        new { i, j }.Dump("exceptional");
                        throw;
                    }

                }
            dungeon.Dump();
            
        }

    }
}